<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <ul>
        <!--v-for="(值,索引) in 数组或对象 "  -->
        <li v-for="(v,i) of hobby" :key="v">{{v}},{{i}}</li>
      </ul>
      <button @click="set">set</button>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          hobby: ["css", "html", "js"],
        },
        methods: {
          set() {
            this.flag = !this.flag;
          },
        },
      });
    </script>
  </body>
</html>
